#region Using declarations
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Strategy;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    partial class Strategy
    {
		public IDataSeries getPriceByType(string priceType)
		{
			switch (priceType.ToLower())
			{
				case "close":
					return Close;
					
				case "open":
					return Open;
					
				case "high":
					return High;
					
				case "low":
					return Low;

				default:
					return null;
			}
		}
		
		public int NormalizeYear(int YYY)
		{
			int result = YYY;
			if( YYY < 1900)
			{
				int last2Digit = YYY % 100;
				if ( YYY - last2Digit == 100)
					result = 2000 + last2Digit;
			}
			return result;
		}
		
		public int DateToTSDate(int date)
		{
			return (int)(date - (Floor(date/1000000)*1000000) + 1000000);
		}
		
    }
}
